/**
 * Created by no1 on 2015/6/26.
 */
"use strict";

var F = require('./function');

function o2o_service_API(Env) {
    let action = Env['action'];
    let I = Env['I'];

    let op = o2o_service_API.prototype;
    if (op.hasOwnProperty(action)) {
        let fn = op[action];
        //let ret = yield fn(I);
        //return ret;
        return F.returnMsg(200, 'OK', {});
    } else {
        // not has this service
        // 'not support service: ' + action;
        return F.returnMsg(400, 'Error', 3);
    }
}


var op = o2o_service_API.prototype;
op.testService = function*(args) {
    //return 'testService works fine, I=' + Object.prototype.toString.call(args);
    return F.returnMsg(200, 'OK', 3, 'testService works fine, I=' + Object.prototype.toString.call(args));
};

/**
 * TODO
 * ��ȡ�̻��б�
 * @param args ɸѡ/��������
 */
op.vendorList = function*(args) {

};

/**
 * TODO
 * ��ȡһ�����е�����
 * @param args:����
 */
op.zoneList = function*(args) {

};

/**
 * TODO
 * ��ȡ��Ʒ�б�
 * @param args ɸѡ���� + �������� + ��ҳ
 */
op.wareList = function*(args) {

};

/**
 * TODO
 * ��Ʒ����,�������������۵�
 * @param args ��Ʒid
 */
op.wareInfo = function*(args) {

};

module.exports = o2o_service_API;